home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 July / 1984-07.d64 / space patrol_64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  7KB  |  240 lines

  1. 10 dim l%(12)
  2. 20 ba=20:sc=0:bi=20:bl=500
  3. 30 so=32768:vo=53248:mf=49530:s=54272
  4. 40 gosub1570
  5. 50 op=5:pokemf+0,1
  6. 60 ifpeek(mf+6)=.then90
  7. 70 pokemf+6,0:ifdithenpokeso+1016,peek(so+1016)-2:di=0:goto90
  8. 80 a$=right$(a$,1)+left$(a$,49):poke214,22:print:print""left$(a$,40);
  9. 90 ifpeek(mf+7)=.then120
  10. 100 pokemf+7,0:ifdi=.thenpokeso+1016,peek(so+1016)+2:di=1:goto120
  11. 110 a$=right$(a$,49)+left$(a$,1):poke214,22:print:print""left$(a$,40);
  12. 120 ifpeek(mf+4)=.thenpokemf+4,hf:sys49389
  13. 130 ifpeek(mf+8)thengosub940:pokemf+8,0
  14. 140 ifba=.andpeek(so+939)=45andpeek(56320)=125andpeek(vo+1)=227thengosub640
  15. 150 ifpeek(mf)then170
  16. 160 pokemf,1:op=op-1:pokeso+30+2*op,30:pokeso+31+2*op,31:gosub430
  17. 170 getr$:ifr$<>""thengosub390:goto170
  18. 180 ifop>0then60
  19. 190 ifsc>hithenhi=sc
  20. 200 h1=int(hi/65536):poke820,h1
  21. 210 hi=hi-h1*65536:h1=int(hi/256):poke821,h1
  22. 220 h1=hi-h1*256:poke822,h1
  23. 230 print"[158]":i$="[145]^_^_^_^_^_"
  24. 240 fori=29to0step-1:gosub430
  25. 250 ifpeek(mf+4)then250
  26. 260 pokemf+4,5
  27. 270 i$=i$+left$(right$(i$,2),1)
  28. 280 printspc(i)i$;:next
  29. 290 fori=1to21:print:printi$;:gosub430
  30. 300 ifpeek(mf+4)then300
  31. 310 pokemf+4,10:next
  32. 320 print"[159]"spc(8)"   play again?(y or n)  "
  33. 330 geta$:ifa$=""then330
  34. 340 ifa$="n"then360
  35. 350 run
  36. 360 poke56576,199:poke53272,20:poke648,4:pokevo+21,0:end
  37. 370 print "data error found- check for typo's":goto360
  38. 380 :    pause function
  39. 390 ifasc(r$)<>133thenreturn
  40. 400 getr$:ifr$=""then400
  41. 410 return
  42. 420 :    sounds
  43. 430 pokes+15,20:pokes+17,4:pokes+19,9
  44. 440 pokes+18,64:pokes+18,65:return
  45. 450 pokes+15,10:pokes+19,9
  46. 460 pokes+18,128:pokes+18,129:return
  47. 470 pokes+18,32:pokes+15,10
  48. 480 pokes+19,30
  49. 490 pokes+18,33:return
  50. 500 pokes+15,35:pokes+19,1:forj=1to5:next
  51. 510 pokes+18,32:pokes+18,33:return
  52. 520 :    set difficulty level
  53. 530 print "select difficulty level(1to5)"
  54. 540 getr$:ifr$=""then540
  55. 550 if asc(r$)<49 then 540
  56. 560 if asc(r$)>53 then 540
  57. 570 dl=asc(r$)-48
  58. 580 hf=20-4*dl
  59. 590 nl=13-dl
  60. 600 pokemf+1,nl
  61. 610 si=1+2*dl+int(dl^2/2)
  62. 620 print "[145]                                     ":return
  63. 630 :     get more bombs
  64. 640 bi=bi-2-int(dl/2):ifbi<5thenbi=5
  65. 650 ba=bi:hf=hf-1:ifhf<0thenhf=0
  66. 660 fori=so+919toso+959-ba*40step-40:pokei,27:gosub500:next
  67. 670 pokeso+1016,peek(so+1016)-1
  68. 680 return
  69. 690 :    bonus
  70. 700 bl=300:pokevo+3,250
  71. 710 gosub470:k=10
  72. 720 fori=250to50step-1:pokevo+5,i:pokes+15,k:k=k+1:next
  73. 730 ifop=5thensc=sc+si:bo=bo+si:goto870
  74. 740 pokevo+2,241:pokevo+3,53
  75. 750 t=so+30-2*op
  76. 760 i=241:ii=0:pokevo+16,peek(vo+16)and253
  77. 770 gosub450:k=10
  78. 780 ifi=257thenii=256:pokevo+16,peek(vo+16)or2
  79. 790 pokevo+2,i-ii:ifi>266+16*opthen820
  80. 800 k=k+8:ifk<40thenpokes+15,k
  81. 810 i=i+8:goto780
  82. 820 pokevo+2,250:sl=so+30+2*op:op=op+1
  83. 830 pokesl,28:pokesl+1,29
  84. 840 gosub450:fork=10to18step4:pokes+15,k:nextk
  85. 850 pokevo+2,0:pokevo+3,0
  86. 860 pokesl,32:pokesl+1,32
  87. 870 sc=sc+si:bo=bo+si
  88. 880 ss$=str$(sc):print"[151]"spc(31-len(ss$))right$(ss$,len(ss$)-1)
  89. 890 fori=1to200:next
  90. 900 gosub470:k=211
  91. 910 fori=50to250:pokevo+5,i:pokes+15,k:k=k-1:next
  92. 920 pokes+15,0:pokevo+16,0:return
  93. 930 :    track shot
  94. 940 ifba=.thenreturn
  95. 950 rw=32768+int((peek(vo+1)-46)/8)*40
  96. 960 pokevo+3,peek(vo+1)+3:px=173+di*28
  97. 970 gosub450:k=10:ifdithen1040
  98. 980 fori=rw+18torwstep-2:ifpeek(i)=31thensl=i-1:i=rw-2
  99. 990 ifpeek(i)=30thensl=i:i=rw-2
  100. 1000 pokevo+2,px:px=px-16:ifk<40thenk=k+4:pokes+15,k
  101. 1010 next
  102. 1020 ifi=rw-2then1180
  103. 1030 goto1100
  104. 1040 ix=0:fori=rw+21torw+37step2:ifpeek(i)=30thensl=i:i=rw+39
  105. 1050 ifpeek(i)=31thensl=i-1:i=rw+39
  106. 1060 pokevo+2,px-ix:px=px+16:ifpx=265thenix=256:pokevo+16,2
  107. 1070 ifk<40thenk=k+4:pokes+15,k
  108. 1080 next
  109. 1090 ifi=rw+39then1180
  110. 1100 pokesl,28:pokesl+1,29:gosub450
  111. 1110 tl=sl-65536:fori=0tonl:ifl%(i)=tlthenl%(i)=0:i=nl+1
  112. 1120 next
  113. 1130 fork=10to18step4:pokes+15,k:next
  114. 1140 sc=sc+si:ss$=str$(sc):print"[151]"spc(31-len(ss$))right$(ss$,len(ss$)-1)
  115. 1150 pokesl,32:pokesl+1,32
  116. 1160 bo=bo+si
  117. 1170 ifbo>blthenbo=bo-bl:gosub700
  118. 1180 pokevo+2,0:pokevo+3,0:pokevo+16,0
  119. 1190 poke(so+159+(20-ba)*40),32:ba=ba-1:ifba=.thenpokeso+1016,peek(so+1016)+1
  120. 1200 return
  121. 1210 :    initialize screen
  122. 1220 a$=",,,,,,,,,,-./,,,,,,,,,,,,,,,,-./,,,,,,,,,,,,,-./,,"
  123. 1230 b$="+++++++++++++++++++++++++++++++++++++++"
  124. 1240 fori=stos+23:pokei,0:next
  125. 1250 pokes+23,0:pokes+22,18
  126. 1260 pokes,32:pokes+1,2:pokes+24,31:pokes+3,14
  127. 1270 pokes+5,40:pokes+6,0
  128. 1280 pokevo+33,0:pokevo+32,12
  129. 1290 print"[147][147][151] high:00000"spc(8)"score:00000"
  130. 1300 ss$=str$(hi):print"[151]"spc(12-len(ss$))right$(ss$,len(ss$)-1)
  131. 1310 poke214,22:print:print""left$(a$,40)b$;
  132. 1320 sys49420:pokevo+39,1:pokevo+40,1
  133. 1330 pokevo+41,1:pokevo+21,7:pokemf+8,0
  134. 1340 pokeso+999,43:pokeso+23527,5
  135. 1350 fori=so+159toso+919step40:pokei,27
  136. 1360 pokei+22528,2:next
  137. 1370 pokeso+1016,16:pokevo+1,100:pokevo,176:pokevo+16,0:di=0
  138. 1380 pokeso+1017,20:pokeso+1018,18
  139. 1390 pokevo+2,0:pokevo+3,0
  140. 1400 pokevo+5,250:pokevo+4,216
  141. 1410 fori=55326to55335:pokei,7:next
  142. 1420 return
  143. 1430 :    load data
  144. 1440 print"[147]       loading data   please wait"
  145. 1450 poke56334,peek(56334)and254
  146. 1460 poke1,peek(1)and251
  147. 1470 fori=34816to35327:pokei,peek(i+18432):next
  148. 1480 poke1,peek(1)or4
  149. 1490 poke56334,peek(56334)or1
  150. 1500 fori=so+1024toso+1343:pokei,0:next:pokeso+1280,255
  151. 1510 readl:ifl=0thengoto1530
  152. 1520 fori=0to7:reada:pokel+i,a:ck=ck+a:next:goto1510
  153. 1530 ifck<>63389then370
  154. 1540 poke251,111
  155. 1550 return
  156. 1560 ;    move screen to top of basic
  157. 1570 poke648,128
  158. 1580 poke56576,peek(56576)and252or1
  159. 1590 pokevo+24,2
  160. 1600 ifpeek(251)<>111thengosub1440
  161. 1610 pokevo+32,11:pokevo+33,11
  162. 1620 poke56,127:poke52,127
  163. 1630 hi=peek(820)*65536+peek(821)*256+peek(822)
  164. 1640 gosub 1220:gosub530
  165. 1650 return
  166. 1660 :   character data
  167. 1670 data35032,0,0,0,125,255,125,0,0
  168. 1680 data35040,16,70,185,134,93,82,195,16
  169. 1690 data35048,8,82,131,212,43,117,66,4
  170. 1700 data35056,0,63,96,255,204,127,0,0
  171. 1710 data35064,0,252,6,255,51,254,0,0
  172. 1720 data35160,255,255,255,255,255,255,255,255
  173. 1730 data35168,0,0,0,0,0,0,0,0
  174. 1740 data35176,255,63,15,15,15,15,15,15
  175. 1750 data35184,255,255,255,195,0,0,0,0
  176. 1760 data35192,255,252,240,240,240,240,240,240
  177. 1770 :   sprite data
  178. 1780 data33792,7,255,254,30,0,7,127,254
  179. 1790 data33800,63,0,0,63,127,254,63,0
  180. 1800 data33808,240,63,0,63,254,0,0,0
  181. 1810 data33856,7,255,254,30,0,7,127,254
  182. 1820 data33864,1,0,0,1,127,254,1,0
  183. 1830 data33872,240,1,0,63,254,0,0,0
  184. 1840 data33920,127,255,224,224,0,120,128,127
  185. 1850 data33928,254,252,0,0,252,127,254,252
  186. 1860 data33936,15,0,127,252,0,0,0,0
  187. 1870 data33984,127,255,224,224,0,120,128,127
  188. 1880 data33992,254,128,0,0,128,127,254,128
  189. 1890 data34000,15,0,127,252,0,0,0,0
  190. 1900 :   ml routines
  191. 1910 data49152,166,47,134,95,166,48,134,96
  192. 1920 data49160,160,0,177,95,201,204,240,16
  193. 1930 data49168,160,2,177,95,24,101,95,133
  194. 1940 data49176,95,144,0,230,96,76,8,192
  195. 1950 data49184,96,165,143,162,3,10,202,208
  196. 1960 data49192,252,24,101,143,10,24,101,143
  197. 1970 data49200,24,105,59,133,143,74,74,56
  198. 1980 data49208,229,11,176,252,101,11,133,11
  199. 1990 data49216,96,24,32,148,177,160,0,177
  200. 2000 data49224,88,208,63,162,40,134,93,162
  201. 2010 data49232,128,134,94,162,34,134,11,32
  202. 2020 data49240,33,192,165,11,201,18,48,7
  203. 2030 data49248,201,21,16,3,24,105,17,101
  204. 2040 data49256,93,133,93,144,2,230,94,160
  205. 2050 data49264,0,177,93,201,32,208,93,200
  206. 2060 data49272,177,93,201,32,208,86,165,93
  207. 2070 data49280,145,88,165,94,136,145,88,76
  208. 2080 data49288,189,192,177,88,133,94,200,177
  209. 2090 data49296,88,133,93,160,40,177,93,201
  210. 2100 data49304,32,208,58,200,177,93,201,32
  211. 2110 data49312,208,51,169,32,160,0,145,93
  212. 2120 data49320,200,145,93,165,93,24,105,40
  213. 2130 data49328,133,93,145,88,136,144,6,230
  214. 2140 data49336,94,165,94,145,88,169,30,145
  215. 2150 data49344,93,200,169,31,145,93,165,94
  216. 2160 data49352,24,105,88,133,94,169,7,145
  217. 2170 data49360,93,136,145,93,96,48,253,169
  218. 2180 data49368,32,160,0,145,93,200,145,93
  219. 2190 data49376,136,152,145,88,200,145,88,141
  220. 2200 data49384,122,193,76,212,192,32,0,192
  221. 2210 data49392,160,1,177,95,201,128,240,6
  222. 2220 data49400,32,8,192,76,240,192,173,123
  223. 2230 data49408,193,133,11,32,33,192,230,11
  224. 2240 data49416,32,65,192,96,120,162,25,142
  225. 2250 data49424,20,3,162,193,142,21,3,88
  226. 2260 data49432,96,72,138,72,162,3,189,124
  227. 2270 data49440,193,240,3,222,124,193,202,16
  228. 2280 data49448,245,173,0,220,74,176,11,174
  229. 2290 data49456,1,208,224,59,144,4,202,142
  230. 2300 data49464,1,208,74,176,11,174,1,208
  231. 2